package com.iocup.keybastion.sso;


import com.iocup.keybastion.sso.common.TicketRequestParam;

/**
 * @author xyjxust
 * @create 2022/3/18
 **/
public interface TicketService {

    /**
     * 通过票据获取token
     *
     * @param ticket 票据
     * @return sessionId
     */
    TicketRequestParam getByTicket(String ticket);

    /**
     * 保存票据和token之间的关系
     *
     * @param ticket    票据
     * @param ticketRequestParam 登录token
     */
    void saveTicket(String ticket, TicketRequestParam ticketRequestParam);

    /**
     * 移除掉票据
     *
     * @param ticket
     */
    void removeTicket(String ticket);

    /**
     * 通过sessionId获取票据信息
     *
     * @param sessionId
     * @return
     */
    String getTicketBySessionId(String sessionId);

}
